﻿(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["chunk-3c0c7137"], {
    "310d": function(e, s, t) {
        "use strict";
        t.r(s);
        var n = function() {
            var e = this
              , s = e.$createElement
              , t = e._self._c || s;
            return t("section", {
                staticClass: "SecurityCard-rush-answer"
            }, [t("section", {
                staticClass: "rush-content"
            }, [e.isNoData ? t("empty-page", {
                attrs: {
                    emptyType: 0
                }
            }) : e._e(), e.isLoadError ? t("empty-page", {
                attrs: {
                    emptyType: 1
                }
            }) : e._e(), e.questionInfo && e.questionInfo.quesInfo && e.questionInfo.quesInfo.type ? t("section", {
                staticClass: "ques-content"
            }, [t("section", {
                staticClass: "ques-top"
            }, [t("section", {
                staticClass: "top-type"
            }, [e._v(e._s(e.getTypeTitle(e.questionInfo.quesInfo.type)))]), t("section", {
                staticClass: "top-num"
            }, [e._v(e._s(e.currobj.current || "") + "/" + e._s(e.currobj.total || ""))])]), t("section", {
                staticClass: "ques-title"
            }, [e._v(e._s(e.questionInfo.question || ""))]), e.questionInfo.quesInfo ? t("section", {
                staticClass: "ques-options-section"
            }, [e.questionInfo && e.questionInfo.quesInfo && e.questionInfo.quesInfo.type && 4 == e.questionInfo.quesInfo.type ? t("section", {
                staticClass: "ques-options-section gap"
            }, [t("div", {
                staticClass: "topic"
            }, e._l(e.questionInfo.fillSize, (function(s, n) {
                return t("div", {
                    key: n,
                    staticClass: "topic-item",
                    class: {
                        InputCorrect: e.emptyAnswer[n] !== e.type4UserAnswer[n].userAnswer && e.isInputCorrect
                    },
                    on: {
                        click: function(s) {
                            return e.inputClick(s, n)
                        }
                    }
                }, [t("div", {
                    staticClass: "item-num"
                }, [e._v("【" + e._s(n + 1) + "】")]), t("div", {
                    staticClass: "item-input",
                    class: {
                        focus: e.type4UserAnswer[n].focus
                    }
                }, e._l(s, (function(s, i) {
                    return t("div", {
                        key: i,
                        staticClass: "item-input-item",
                        class: {
                            has: i < e.type4UserAnswer[n].userAnswer.length
                        }
                    }, [[t("div", [e._v(e._s(e.type4UserAnswer[n].userAnswer[i]))])]], 2)
                }
                )), 0), t("input", {
                    directives: [{
                        name: "model",
                        rawName: "v-model",
                        value: e.type4UserAnswer[n].userAnswer,
                        expression: "type4UserAnswer[index].userAnswer"
                    }],
                    attrs: {
                        maxlength: s,
                        disabled: e.isInputCorrect
                    },
                    domProps: {
                        value: e.type4UserAnswer[n].userAnswer
                    },
                    on: {
                        blur: function(s) {
                            return e.answerType4Fn(s, n)
                        },
                        input: function(s) {
                            s.target.composing || e.$set(e.type4UserAnswer[n], "userAnswer", s.target.value)
                        }
                    }
                })])
            }
            )), 0), e.curAnswer ? t("span", {
                staticClass: "icon options",
                class: {
                    right: "1" == e.isSingle(e.userAnswer),
                    wrong: "2" == e.isSingle(e.userAnswer)
                }
            }) : e._e()]) : e._e(), 3 == e.questionInfo.quesInfo.type ? t("ul", {
                staticClass: "ques-options-section"
            }, e._l(e.getJudgeOpt(), (function(s, n) {
                return t("li", {
                    key: n,
                    class: {
                        active: e.getActive(n, s.val),
                        exactness: e.ShowAnswer == s.val
                    },
                    on: {
                        click: function(t) {
                            return e.selectKeyFn(s.val, n)
                        }
                    }
                }, [t("span", {
                    staticClass: "icon options",
                    class: {
                        active: e.getActive(n, s.val),
                        right: "1" == e.isSingle(s.val),
                        wrong: "2" == e.isSingle(s.val)
                    }
                }, [e._v(e._s(e.formatterIndex[n]))]), t("span", {
                    staticClass: "ques-options"
                }, [e._v(e._s(s.value))])])
            }
            )), 0) : e._e(), 1 == e.questionInfo.quesInfo.type ? t("ul", {
                staticClass: "ques-options-section"
            }, e._l(e.questionInfo.quesInfo.opt, (function(s, n) {
                return t("li", {
                    key: n,
                    class: {
                        active: e.getActive(n, s),
                        exactness: e.ShowAnswer == s
                    },
                    on: {
                        click: function(t) {
                            return e.selectKeyFn(s, n)
                        }
                    }
                }, [t("span", {
                    staticClass: "icon options",
                    class: {
                        active: e.getActive(n, s),
                        right: "1" == e.isSingle(s),
                        wrong: "2" == e.isSingle(s)
                    }
                }, [e._v(e._s(e.formatterIndex[n]))]), t("span", {
                    staticClass: "ques-options"
                }, [e._v(e._s(s))])])
            }
            )), 0) : e._e(), 2 == e.questionInfo.quesInfo.type ? t("ul", {
                staticClass: "ques-options-section"
            }, e._l(e.questionInfo.quesInfo.opt, (function(s, n) {
                return t("li", {
                    key: n,
                    class: {
                        activeMany: e.getActive(n, s),
                        exactness: e.isSelectRight(s, e.questionInfo.quesInfo) && e.isInputCorrect,
                        activeErr: !e.isSelectRight(s, e.questionInfo.quesInfo) && e.isInputCorrect
                    },
                    on: {
                        click: function(t) {
                            return e.selectKeyFn(s, n)
                        }
                    }
                }, [t("span", {
                    staticClass: "icon options",
                    class: {
                        active: e.getActive(n, s),
                        right: e.isSelectRight(s, e.questionInfo.quesInfo),
                        wrong: 2 == e.isRight(s)
                    }
                }, [e._v(e._s(e.formatterIndex[n]))]), t("span", {
                    staticClass: "ques-options"
                }, [e._v(e._s(s))])])
            }
            )), 0) : e._e()]) : e._e(), t("section", {
                staticClass: "ques-bank"
            }, [e.questionInfo.comName && "" != e.questionInfo.comName ? t("section", {
                staticClass: "ques-bank-left"
            }, [e._v("出题：" + e._s(e.questionInfo.comName || ""))]) : e._e(), e.questionInfo.quesAnalysis && "" != e.questionInfo.quesAnalysis ? t("section", {
                staticClass: "ques-bank-right",
                on: {
                    click: function(s) {
                        e.showAnalysis = !e.showAnalysis
                    }
                }
            }, [t("i"), e._v("查看提示\n        ")]) : e._e()]), e.showAnalysis ? t("section", {
                staticClass: "ques-analysis"
            }, [t("section", {
                staticClass: "analysis-title"
            }, [e._v("试题解析")]), t("article", [e._v(e._s(e.questionInfo.quesAnalysis || ""))])]) : e._e()]) : e._e()], 1), e.isLoadError ? e._e() : t("section", {
                staticClass: "btns"
            }, [e.questionInfo && e.questionInfo.quesInfo && 3 == e.questionInfo.quesInfo.type || e.questionInfo && e.questionInfo.quesInfo && 1 == e.questionInfo.quesInfo.type ? t("section", {
                staticClass: "next-ques",
                on: {
                    click: e.nextQues4Study
                }
            }, [e._v(e._s(e.currobj.current == e.currobj.total ? "提交答题" : "下一题"))]) : e._e(), e.questionInfo && e.questionInfo.quesInfo && 2 == e.questionInfo.quesInfo.type && !e.isInputCorrect || e.questionInfo && e.questionInfo.quesInfo && 4 == e.questionInfo.quesInfo.type && !e.isInputCorrect ? t("section", {
                staticClass: "next-ques",
                on: {
                    click: e.answerConfirm
                }
            }, [e._v("确定")]) : e._e(), e.isInputCorrect ? t("section", {
                staticClass: "next-ques",
                on: {
                    click: e.nextQues4Study
                }
            }, [e._v(e._s(e.currobj.current == e.currobj.total ? "提交答题" : "下一题"))]) : e._e()])])
        }
          , i = []
          , o = (t("f548"),
        t("6d57"),
        t("be31"))
          , r = t("dd0e")
          , a = (t("a336"),
        {
            name: "SecurityCard",
            components: {
                emptyPage: r["a"]
            },
            data: function() {
                return {
                    backUrl: "/study/index",
                    popDialog: !1,
                    Selected: !1,
                    showAnalysis: 1,
                    ShowAnswer: "",
                    popMsgInfo: {
                        title: "提示",
                        msgInfo: "",
                        msgSubInfo: "",
                        leftBtn: "",
                        rightBtn: "",
                        params: "",
                        type: 0,
                        only: 0
                    },
                    gateId: "",
                    workId: "",
                    limitTime: "",
                    rushTime: "",
                    rushTimeText: "",
                    currobj: {},
                    questionInfo: {},
                    Map: {
                        1: {
                            title: "单选题",
                            answer: ""
                        },
                        2: {
                            title: "多选题",
                            answer: []
                        },
                        3: {
                            title: "判断题",
                            data: [{
                                value: "正确",
                                val: "对"
                            }, {
                                value: "错误",
                                val: "错"
                            }],
                            answer: ""
                        },
                        4: {
                            title: "填空题",
                            answer: ""
                        }
                    },
                    formatterIndex: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "G", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
                    canNext: !0,
                    selects: 0,
                    curAnswer: [],
                    userAnswer: "",
                    type4UserAnswer: [],
                    timer: null,
                    source: "",
                    isNoData: !1,
                    isLoadError: !1,
                    emptyAnswer: [],
                    emptyType4: [{
                        userAnswer: ""
                    }],
                    isInputCorrect: !1
                }
            },
            methods: {
                inputClick: function(e, s) {
                    var t = this
                      , n = this.type4UserAnswer;
                    n && n.length > 0 && (n.forEach((function(e) {
                        e.focus && t.$set(e, "focus", !1)
                    }
                    )),
                    n[s].focus = !0)
                },
                goBack: function() {
                    this.popDialog || this.$router.replace({
                        path: this.backUrl,
                        query: {
                            id: this.workId,
                            source: this.source
                        }
                    })
                },
                getTypeTitle: function(e) {
                    return e && this.Map[e] && this.Map[e].title ? this.Map[e].title : ""
                },
                getJudgeOpt: function() {
                    return this.questionInfo && this.questionInfo.quesInfo.type && this.Map && this.Map[this.questionInfo.quesInfo.type].data ? this.Map[this.questionInfo.quesInfo.type].data : ""
                },
                getActive: function(e, s) {
                    return !!s && (3 == this.questionInfo.quesInfo.type || 1 == this.questionInfo.quesInfo.type ? this.Map[this.questionInfo.quesInfo.type].answer == s : 2 == this.questionInfo.quesInfo.type ? this.Map[this.questionInfo.quesInfo.type].answer[e].answer == s : void 0)
                },
                isSingle: function(e) {
                    return this.userAnswer && this.userAnswer == e && this.curAnswer && "string" == typeof this.curAnswer && this.curAnswer.constructor == String ? this.curAnswer == e ? "1" : "2" : "3"
                },
                hasCurAnswer: function() {
                    return !(!this.curAnswer || "string" != typeof this.curAnswer || this.curAnswer.constructor != String)
                },
                isRight: function(e) {
                    var s = !1
                      , t = !1
                      , n = !0;
                    return this.type4UserAnswer && this.type4UserAnswer.length > 0 && this.type4UserAnswer instanceof Array && (s = this.type4UserAnswer.some((function(s) {
                        return s.answer == e
                    }
                    )),
                    this.curAnswer && this.curAnswer.length > 0 && this.curAnswer instanceof Array && (n = !1,
                    t = this.curAnswer.some((function(s) {
                        return s == e
                    }
                    )))),
                    s && t && !n ? "1" : !s || t || n ? "3" : "2"
                },
                getStartRushInfo: function() {
                    var e = this
                      , s = this;
                    s.isLoadError = !1,
                    s.isNoData = !1,
                    this.$openLoading(),
                    this.$axios.get(o["a"].study.startRush, {
                        params: {
                            id: s.workId,
                            isClock: "1"
                        }
                    }).then((function(t) {
                        if (e.$closeLoading(),
                        "1" == t.code && t.data) {
                            if (s.currobj = Object.assign({}, t.data),
                            s.questionInfo = t.data.currentQuesInfo,
                            s.questionInfo['quesAnalysis'] = JSON.parse(s.questionInfo.answer)["answer"],
                            s.questionInfo["quesInfo"] = JSON.parse(s.questionInfo.answer),
                            console.log(s.questionInfo),
                            s.questionInfo.fillSize && s.questionInfo.fillSize.length > 0) {
                                var n = Object.assign([], s.questionInfo.fillSize)
                                  , i = [];
                                n && n.length > 0 && (n.forEach((function(e, s) {
                                    var t = {
                                        key: s,
                                        userAnswer: "",
                                        focus: !1
                                    };
                                    i.push(t)
                                }
                                )),
                                s.type4UserAnswer = Object.assign([], i))
                            }
                            s.typeFn()
                        } else
                            s.$dialog.toast({
                                mes: t.msg,
                                icon: "none",
                                timeout: 2e3,
                                callback: function() {
                                    s.timer && clearInterval(s.timer),
                                    s.$router.push({
                                        path: s.backUrl
                                    })
                                }
                            })
                    }
                    )).catch((function(s) {
                        e.isLoadError = !0,
                        e.$closeLoading()
                    }
                    ))
                },
                typeFn: function() {
                    var e = this
                      , s = this.questionInfo.quesInfo.type
                      , t = {
                        1: {
                            title: "单选题",
                            answer: ""
                        },
                        2: {
                            title: "多选题",
                            answer: []
                        },
                        3: {
                            title: "判断题",
                            data: [{
                                value: "正确",
                                val: "对"
                            }, {
                                value: "错误",
                                val: "错"
                            }],
                            answer: ""
                        },
                        4: {
                            title: "填空题",
                            answer: ""
                        }
                    };
                    2 == s && e.questionInfo.quesInfo.opt.forEach((function(e, n) {
                        t[s].answer.push({
                            answer: ""
                        })
                    }
                    )),
                    e.Map = t
                },
                exitRushPro: function() {
                    var e = this;
                    setTimeout((function() {
                        e.popMsgInfo.type = 1,
                        e.popDialog = !0,
                        "IOS" == localStorage.getItem("sys") && window.webkit.messageHandlers.appJS.postMessage("showCoverView")
                    }
                    ), 50)
                },
                exitRush: function() {
                    var e = this
                      , s = this;
                    s.timer && (clearInterval(s.timer),
                    s.timer = null),
                    this.$dialog.loading.open("加载中..."),
                    this.$axios.post(o["a"].rush.exitRush, {
                        sequenceId: s.gateId
                    }).then((function(t) {
                        e.$dialog.loading.close(),
                        1 == t.code ? s._rushGateState4Study(t) : s.goBack()
                    }
                    )).catch((function(t) {
                        e.$dialog.loading.close(),
                        s.$dialog.toast({
                            mes: t.msg,
                            icon: "none",
                            timeout: 2e3,
                            callback: function() {
                                s.goBack()
                            }
                        })
                    }
                    ))
                },
                _rushGateState4Study: function(e) {
                    var s = this
                      , t = "";
                    if (e.data && (t = e.data.isEnd),
                    1 == t) {
                        var n = {
                            workTypeId: e.data.result.workTypeId || "",
                            star: e.data.result.star || "",
                            correctNum: e.data.result.correctNum || "",
                            errorNum: e.data.result.errorNum || "",
                            time: e.data.result.time || ""
                        };
                        return s.$router.push({
                            path: "/SecurityCard/takeAnOath",
                            query: {
                                data: JSON.stringify(n),
                                id: e.data.id,
                                backPath: s.backUrl
                            }
                        }),
                        !0
                    }
                    return !1
                },
                answerConfirm: function() {
                    this.isInputCorrect = !0,
                    this.emptyAnswer = JSON.parse(this.questionInfo.answer).answer
                },
                isSelectRight: function(e, s) {
                    for (var t = s.answer, n = 0; n < t.length; n++)
                        if (e == t[n])
                            return !0;
                    return !1
                },
                selectKeyFn: function(e, s) {
                    if (this.canNext && !this.Selected && !this.isInputCorrect) {
                        var t = this.questionInfo.quesInfo.type
                          , n = e
                          , i = s
                          , o = this.Map;
                        2 == t ? (o[t].answer.forEach((function(e, s) {
                            s == i && ("" == o[t].answer[s].answer ? o[t].answer[s].answer = n : o[t].answer[s].answer = "")
                        }
                        )),
                        this.Map = o,
                        this.selects = 1,
                        this.userAnswer = [],
                        this.userAnswer = o[2].answer) : (this.selects = 0,
                        o[t].answer = n,
                        this.Map = o,
                        this.userAnswer = n),
                        1 != t && 3 != t || (this.ShowAnswer = JSON.parse(this.questionInfo.answer).answer[0],
                        this.Selected = !0)
                    }
                },
                nextQues4Study: function() {
                    var e = this
                      , s = this;
                    s.isInputCorrect = !1;
                    var t = s.questionInfo.quesInfo.type
                      , n = this.Map[t].answer;
                    if (this.Selected = !1,
                    4 == t && this.type4UserAnswer.length <= 0)
                        return s.$dialog.toast({
                            mes: "请填写答案",
                            icon: "none",
                            timeout: 1e3
                        }),
                        !1;
                    if (4 !== t && ("" == n || 2 == t && !s.selects))
                        return s.$dialog.toast({
                            mes: "请选择答案",
                            icon: "none",
                            timeout: 1e3
                        }),
                        !1;
                    if (2 == t) {
                        var i = [];
                        n.forEach((function(e, s) {
                            "" != e.answer && i.push('"' + e.answer + '"')
                        }
                        )),
                        n = "[" + i.join(",") + "]"
                    }
                    if (4 == t) {
                        if (this.type4UserAnswer.length > 0) {
                            var r = [];
                            this.type4UserAnswer.forEach((function(e) {
                                r.push('"' + e.userAnswer + '"')
                            }
                            ))
                        }
                        n = "[" + r.join(",") + "]"
                    }
                    console.log(s.canNext),
                    s.canNext && (s.canNext = !1,
                    s.$dialog.loading.open("加载中..."),
                    s.$axios.post(o["a"].study.nextQuestion, {
                        id: s.currobj.id,
                        isClock: "1",
                        oldChoose: n
                    }).then((function(t) {
                        if (e.$dialog.loading.close(),
                        t.code && 1 == t.code) {
                            s.userAnswer = "",
                            s.curAnswer = [],
                            s.ShowAnswer = "";
                            var n = s._rushGateState4Study(t);
                            if (n)
                                return;
                            if (s.currobj = Object.assign({}, t.data),
                            s.questionInfo = t.data.currentQuesInfo,
                            s.questionInfo['quesAnalysis'] = JSON.parse(s.questionInfo.answer)["answer"],
                            s.questionInfo["quesInfo"] = JSON.parse(s.questionInfo.answer),
                            s.questionInfo.fillSize && s.questionInfo.fillSize.length > 0) {
                                var i = Object.assign([], s.questionInfo.fillSize)
                                  , o = [];
                                i && i.length > 0 && (i.forEach((function(e, s) {
                                    var t = {
                                        key: s,
                                        userAnswer: "",
                                        focus: !1
                                    };
                                    o.push(t)
                                }
                                )),
                                s.type4UserAnswer = Object.assign([], o))
                            }
                            s.canNext = !0,
                            s.typeFn(),
                            s.selects = 0,
                            s.showAnalysis = 1
                        } else
                            s.goBack()
                    }
                    )).catch((function(t) {
                        e.$dialog.loading.close(),
                        s.goBack()
                    }
                    )))
                },
                answerFn: function() {
                    if (this.canNext) {
                        var e = "";
                        this.userAnswer && (e = this.userAnswer.replace(/\\/g, "\\\\"),
                        e = e.replace(/[\|]{3}/g, '","'),
                        this.userAnswer = e),
                        this.Map[4].answer = "" === e ? "" : '["' + e + '"]'
                    }
                },
                answerType4Fn: function(e, s) {
                    e.target.value;
                    if (this.canNext) {
                        var t = "";
                        this.type4UserAnswer[s].userAnswer && (t = this.type4UserAnswer[s].userAnswer.replace(/\\/g, "\\\\"),
                        t = t.replace(/[\|]{3}/g, '","'),
                        this.type4UserAnswer[s].userAnswer = t)
                    }
                },
                init: function() {
                    this.source = this.$route.query.source,
                    this.$route.query.backPath && (this.backUrl = this.$route.query.backPath),
                    this.gateId = this.$route.query.id || "",
                    this.workId = this.$route.query.workId || "",
                    this.limitTime = this.$route.query.limitTime || 0,
                    this.rushTime = this.limitTime ? 1e3 * this.limitTime : 0,
                    this.getStartRushInfo()
                }
            },
            created: function() {
                this.init()
            },
            beforeDestroy: function() {
                this.timer && (clearInterval(this.timer),
                this.timer = null)
            }
        })
          , u = a
          , c = (t("c132"),
        t("9ca4"))
          , l = Object(c["a"])(u, n, i, !1, null, null, null);
        s["default"] = l.exports
    },
    "6a24": function(e, s, t) {},
    c132: function(e, s, t) {
        "use strict";
        var n = t("6a24")
          , i = t.n(n);
        i.a
    }
}]);
